package org.top10.dealor;

import java.util.HashMap;
import java.util.Map;

import org.top10.entity.ConfBean;

public class ConfReader {
	private final static Map<String,ConfBean>props=new HashMap<String,ConfBean>();
	static {
		readProp("xunlei_conf");
	}
	public static ConfBean getPropValue(String key){
		return props.get(key);
	}
	private static void readProp(String propName){
		FileDealor.readFile(propName,new LineDealor(){
			public void dealorLine(String line) {
				String []segment=null;
				segment=line.split("\\s+");
				if(segment.length==3){
					props.put(segment[0].trim(),new ConfBean(segment[2].trim(),segment[1].trim(),segment[0].trim()));
				}
			}
		});
		}
}
